<cfsetting enablecfoutputonly="true" />
<!--- @@displayname: List media items as teasers with thumbnails --->
<!--- @@author: Jeff Coughlin (jeff[at]jeffcoughlin[dot]com)--->

<cfimport taglib="/farcry/core/tags/webskin" prefix="skin" />
<cfimport taglib="../../tags/webskin" prefix="myskinPlugin" />

<myskinPlugin:defaultHtmlHead bLoadPluginCssFile="#application.stplugins.jcPodcast.bLoadPluginCssFile#" bLoadJsFile="#application.stplugins.jcPodcast.bLoadJsFile#" />

<cfif listFindNoCase(listLast(stObj.enclosure, "."), "mp3")>
  <cfset variables.bIsMP3 = true />
<cfelse>
  <cfset variables.bIsMP3 = false />
</cfif>

    <cfoutput>
    <div class="jcPodcastEpisodeTeaser">
      <div class="teaserTitle">
        </cfoutput><skin:buildLink objectid="#stObj.objectid#" class="teaserTitleLink"><cfoutput>#stObj.title#</cfoutput></skin:buildLink><cfoutput>
      </div></cfoutput>
      <cfif isdefined("stObj.subTitle") and len(stObj.subTitle)>
      <cfoutput>
      <div class="jcPodcastSubTitle">#stObj.subTitle#</div></cfoutput>
      </cfif>
      <cfoutput>
      <div class="jcPodcastEpisodeDate"><cfif stObj.publishDate neq "">#dateFormat(stObj.publishDate, "mmmm d, yyyy")#</cfif></div>
      <div class="jcPodcastEpisideDescription">#stObj.description#</div>
      </cfoutput>
      <cfif variables.bIsMP3 is true>
        <skin:view typename="jcPodcastEpisode" objectid="#stObj.objectID#" webskin="displayAudioPlayer" />
      </cfif>
      <cfoutput>
      <div class="jcPodcastEpisodeDownload"><cfif variables.bIsMP3 is true><a href="#application.url.webroot#/download.cfm?downloadfile=#stObj.objectId#&amp;typename=jcPodcastEpisode&amp;fieldname=enclosure"><img src="#application.stplugins.jcPodcast.url.pluginroot#/wsimages/mediaIcons/mp3.png" alt="Download MP3" /></a></cfif><cfif stObj.duration neq "">duration [#stObj.duration#m]: </cfif><a href="#application.url.webroot#/download.cfm?downloadfile=#stObj.objectId#&amp;typename=jcPodcastEpisode&amp;fieldname=enclosure">Download</a></div>
    </div></cfoutput>

<cfsetting enablecfoutputonly="false" />